package br.edu.ufcg.msnlab2.grupo02.booleSimpson;

import br.edu.ufcg.msnlab2.misc.Function;
import br.edu.ufcg.msnlab2.misc.NumericalIntegrationMethod;

public class Simpsons38Rule implements NumericalIntegrationMethod {

	@Override
	public double integrate( Function f, double a, double b ) {
		return (b - a)/8*(f.evaluate( a ) + 3*f.evaluate( (2*a + b)/3 ) + 3*f.evaluate( (a + 2*b)/3 ) + f.evaluate( b ));
	}

}
